package demo;

import demo.bean.ConsumerComponent;
import demo.config.ConsumerConfig;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.Scanner;

/**
 * @author m0v1
 * @date 2021年09月21日 12:18 上午
 */
public class ConsumerBootStrap {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ConsumerConfig.class);
        context.start();

        ConsumerComponent consumerComponent = context.getBean(ConsumerComponent.class);

        while (true) {
            System.out.println("please enter a name:");
            Scanner scanner = new Scanner(System.in);
            String name = scanner.nextLine();
            consumerComponent.sayHello2Name(name);
        }
    }
}
